import { Component, ViewChild } from '@angular/core';

import { AlertController, App, ItemSliding, List, ModalController, NavController } from 'ionic-angular';

import { ConferenceData } from '../../providers/conference-data';
import { ScheduleFilterPage } from '../schedule-filter/schedule-filter';
import { SessionDetailPage } from '../session-detail/session-detail';
import { UserData } from '../../providers/user-data';
import {Response} from "@angular/http";
import {AppData} from "../../providers/app-data";
import {MachineDetailPage} from "../machine-detail/machine-detail";


@Component({
  templateUrl: 'build/pages/online/online.html'
})
export class OnlinePage {
  onlineList = [];
  constructor(public navCtrl: NavController, public appData: AppData) {}

  ionViewDidEnter() {
    this.appData.getOnlineMachineList().then((res: Response) => {
      this.onlineList = res.json().result;
    });
  }

  goToMachineDetail(machine) {
    this.navCtrl.push(MachineDetailPage, machine);
  }

}
